function [ Degree_new, Candidate_new, associationUser_new ] = update_degree_candidate( SINRinfo_db, LA, associationUser_old,Degree_old, Candidate_old )
global Load_max BSnum

unassociated=find(associationUser_old==0);
total=size(find(associationUser_old==0),2);
for i=1:total
    j=unassociated(i);
    
    index=find(SINRinfo_db(j,:)>-10);
    index1=find(LA<Load_max);
    can=intersect(index,index1);
    if isempty(can)     
       associationUser_old(1,j)=BSnum+1;
    else
    Degree_old(j)=size(can,2);
    Candidate_old(j,1:Degree_old(j))=can;
   end
    
Degree_new=Degree_old;
Candidate_new=Candidate_old;
associationUser_new=associationUser_old;
end

